package StudyCode.summary.zipfile;

import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReadByteByByteWithInputStreamUnbufferedStream {
	public static void main(String[] args) {
		Path path = Paths.get("E:/Copy/", "2.txt");

		int n;
		byte[] in_buffer = new byte[1024];
		try (InputStream in = Files.newInputStream(path)) {
			while ((n = in.read(in_buffer)) != -1) {
				System.out.println(new String(in_buffer));
			}
		} catch (IOException e) {
			System.err.println(e);
		}

	}
}
